FROM node:9.9.0-alpine
ENV NODE_ENV prod
ENV PORT 80
RUN apk update && apk add ca-certificates && \
    apk add tzdata && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
COPY ./config/prod.json /usr/src/app/config/
# COPY ./config/log4js.json /usr/src/app/config/
COPY ./dist/ /usr/src/app
# COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./dist/"]
# RUN npm install pm2 -g --registry=https://registry.npm.taobao.org
RUN npm install --production --silent --registry=https://registry.npm.taobao.org
EXPOSE 80
# RUN cd /usr/src/app/config
CMD npm start